@extends('master')

@section('title')
    管理员
@stop

@section('content')
    <div class="container">
        <div class="row mt-5">
            <div class="col-md-10">
                @include('errors.list')

                <h3 align="center">用户信息表</h3>
                <table class="table table-hover">
                    <tr>
                        <td>用户编号</td>
                        <td>用户名</td>
                        <td>openID</td>
                        <td>手机号</td>
                        <td>电子邮箱</td>
                        <td>性别</td>
                        <td>积分</td>
                        <td>学号</td>
                        <td>真实姓名</td>
                        <td>学院</td>
                    </tr>
                    @if (count($users))
                        @foreach ($users as $user)
                            <tr>
                                <td>{{ $user->id }}</td>
                                <td>{{ $user->name }}</td>
                                <td>{{ $user->openID }}</td>
                                <td>{{ $user->phone }}</td>
                                <td>{{ $user->email }}</td>
                                <td>{{ $user->sex }}</td>
                                <td>{{ $user->sweety }}</td>
                                <td>{{ $user->uid }}</td>
                                <td>{{ $user->real_name }}</td>
                                <td>{{ $user->unit }}</td>
                                <td>
                                    <form action="{{ url('users/'.$user->openID.'/destroy') }}" style='display: inline' method="get"
                                          onclick="location.reload()">
                                        <input type="hidden" name="_method" value="POST">
                                        <input type="hidden" name="_token" value="{{csrf_token()}}">
                                        <button class="btn btn-sm btn-danger" onclick="return confirm('确定删除?')">删除</button>
                                    </form>
                                </td>
                            </tr>

                        @endforeach
                    @else
                        <h1>暂无用户显示</h1>
                    @endif
                </table>
                <?php echo $users->render(); ?>
            </div>

            {{--@include('Admin.right_bar')--}}
        </div>
    </div>
@stop